<%@ taglib uri="http://java.sun.com/portlet" prefix="portlet" %>

<%@ page import="javax.portlet.RenderRequest" %>
<%@ page import="javax.portlet.RenderResponse" %>
<%@ page import="javax.portlet.ActionResponse" %>
<%@ page import="javax.portlet.PortletPreferences" %>

<%@ page import="pl.edu.agh.portal.application.types.Message" %>
<%@ page import="pl.edu.agh.portal.application.types.Employee" %>
<%@ page import="pl.edu.agh.portal.application.utils.PortletsUtils" %>

<%@ page session="false" %>

<portlet:defineObjects/>

<% 
Message message = (Message)(renderRequest.getAttribute(PortletsUtils.ATTRIBUTE_MESSAGE_FOR_CREATION));
%>

<form method="post" action="<portlet:actionURL/>">
	<table width="100%">	
		<tr>
			<th width="100%" align="center" colspan ="2"><%= PortletsUtils.USER_MESSAGES_PAGE %></th>
		</tr>
		<tr>
			<td width="20%" align="center">
				<%@ include file="./include/message_menu.inc" %> </td>
			<td width="80%">
				<table width="100%">
					<tr>
						<th align="center"><%= PortletsUtils.MESSAGES_DESTINATION %></th>
						<td align="center"><input type="text" name="<%= PortletsUtils.PARAMETER_MESSAGE_DESTINATION %>" value="<%= message.getDestination() %>"></td>
					</tr> 
					<tr>
						<th align="center"><%= PortletsUtils.MESSAGES_TITLE %></th>
						<td align="center"><input type="text" name="<%= PortletsUtils.PARAMETER_MESSAGE_TITLE %>" value="<%= message.getTitle() %>"></td>
					</tr>
					<tr><td colspan="2"></td></tr>
					<tr>
						<th align="center" colspan="2"><%= PortletsUtils.MESSAGES_CONTENT %></th>						
					</tr>					
					<tr>						
						<td align="center" colspan="2"><textarea name="<%= PortletsUtils.PARAMETER_MESSAGE_CONTENT %>" rows="6" cols="70%"><%= message.getMessage() %></textarea></td>
					</tr>
					<tr><td colspan="2"></td></tr>
					<tr>
						<td align="right" width="50%">
							<input type="image" name="<%= PortletsUtils.MESSAGE_CREATE_KEY %>" value="<%= PortletsUtils.BUTTON_SEND %>" alt="<%= PortletsUtils.BUTTON_SEND %>" height="100%" width="100%""/>
							&nbsp;&nbsp;
						</td>
						<td align="left" width="50%">
							&nbsp;&nbsp;
							<input type="image" name="<%= PortletsUtils.MESSAGE_CREATE_KEY %>" value="<%= PortletsUtils.BUTTON_CANCEL %>" alt="<%= PortletsUtils.BUTTON_CANCEL %>" height="100%" width="100%""/>
						</td>
					</tr>					  									
				</table>				
			</td>
		</tr>
	</table>
</form>


